package com.github.sbb.sherry.repository.mapper;

import com.github.sbb.sherry.repository.entity.WelcomeQuote;
import org.apache.ibatis.annotations.Select;

public interface WelcomeQuoteExtendMapper {

    @Select("SELECT * FROM welcome_quote AS t1 JOIN (SELECT ROUND(RAND()*(SELECT MAX(id)\n"
        + "FROM welcome_quote)) AS id) AS t2 WHERE t1.id>=t2.id ORDER BY t1.id LIMIT 1")
    WelcomeQuote random();
}